<template>
  <div>
    <van-nav-bar :title="title" fixed left-arrow @click-left="leftClick">
    </van-nav-bar>
    <div class="xian"></div>
    <div class="opens">
      <iframe
        :src="url"
        frameborder="0"
        id="show-iframe"
        allowfullscreen
        sameorigin
      >
      </iframe>
    </div>
  </div>
</template>
<script>
export default {
  name: "OpenWeb",
  data() {
    return {
      title: this.$route.params.title,
      url: this.$route.params.url,
    };
  },
  mounted() {
    const oIframe = document.getElementById("show-iframe");
    const deviceWidth = document.documentElement.clientWidth;
    const deviceHeight = document.documentElement.clientHeight;
    oIframe.style.width = deviceWidth + "px";
    oIframe.style.height = deviceHeight + "px";
  },
  methods: {
    leftClick() {
      this.$router.back(-1);
    },
  },
};
</script>
<style scoped>
.xian {
  height: 46px;
}
.opens {
  width: 100%;
  height: 300px;
}
</style>